package com.jl.jlapp.adapter;

import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jl.jlapp.R;
import com.jl.jlapp.eneity.UserCouponInfosModel;

import java.text.SimpleDateFormat;
import java.util.List;

public class UserUsableCouponAdapter
  extends BaseQuickAdapter<UserCouponInfosModel.ResultDataBean.UsableCouponBean, BaseViewHolder>
{
  public UserUsableCouponAdapter(@LayoutRes int paramInt, @Nullable List<UserCouponInfosModel.ResultDataBean.UsableCouponBean> paramList)
  {
    super(paramInt, paramList);
  }
  
  protected void convert(BaseViewHolder paramBaseViewHolder, UserCouponInfosModel.ResultDataBean.UsableCouponBean paramUsableCouponBean)
  {
    SimpleDateFormat localSimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
    TextView localTextView1 = (TextView)paramBaseViewHolder.getView(R.id.tv_discount_explain);
    TextView localTextView2 = (TextView)paramBaseViewHolder.getView(R.id.tv_discount_time_start);
    TextView localTextView3 = (TextView)paramBaseViewHolder.getView(R.id.tv_discount_time_strip);
    TextView localTextView4 = (TextView)paramBaseViewHolder.getView(R.id.tv_discount_time_end);
    TextView localTextView5 = (TextView)paramBaseViewHolder.getView(R.id.tv_discount_money);
    TextView localTextView6 = (TextView)paramBaseViewHolder.getView(R.id.tv_discount_money_unit);
    TextView localTextView7 = (TextView)paramBaseViewHolder.getView(R.id.tv_discount_condition);
    TextView localTextView8 = (TextView)paramBaseViewHolder.getView(R.id.tv_get_coupon);
    RelativeLayout localRelativeLayout = (RelativeLayout)paramBaseViewHolder.getView(R.id.coupon_background);
    paramBaseViewHolder.setText(R.id.tv_discount_explain, paramUsableCouponBean.getCouponInformation().getName());
    paramBaseViewHolder.setText(R.id.tv_discount_money, paramUsableCouponBean.getCouponInformation().getPrice() + "");
    paramBaseViewHolder.setText(R.id.tv_discount_condition, "满¥" + paramUsableCouponBean.getCouponInformation().getUseLimit() + "可用");
    paramBaseViewHolder.setText(R.id.tv_discount_time_start, localSimpleDateFormat.format(Long.valueOf(paramUsableCouponBean.getCouponInformation().getBeginValidityTime())));
    paramBaseViewHolder.setText(R.id.tv_discount_time_end, localSimpleDateFormat.format(Long.valueOf(paramUsableCouponBean.getCouponInformation().getEndValidityTime())));
    paramBaseViewHolder.setText(R.id.tv_get_coupon, "立即使用");
    localTextView8.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.checkGreenColor));
    localTextView8.setBackgroundResource(R.drawable.bg_coupon_green_border);
    localTextView5.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.red));
    localTextView6.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.red));
    localTextView7.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.moreText));
    localTextView1.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.trans_333333));
    localTextView2.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.trans_333333));
    localTextView3.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.trans_333333));
    localTextView4.setTextColor(paramBaseViewHolder.itemView.getResources().getColor(R.color.trans_333333));
    localRelativeLayout.setBackgroundResource(R.drawable.coupe_bg);
    paramBaseViewHolder.addOnClickListener(R.id.tv_get_coupon);
  }
}


/* Location:              /Users/davidzhang/Documents/decompileApk/jlfood-dex2jar.jar!/com/jl/jlapp/adapter/UserUsableCouponAdapter.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */